﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Web;
using System.Text;
using WarehouseWS.BusinessLogic;
using WarehouseWS.Model;

namespace WarehouseWS
{
    // NOTE: You can use the "Rename" command on the "Refactor" menu to change the class name "WarehouseWS" in code, svc and config file together.
    public class WarehouseWS : IWarehouseWS
    {
        public string GetData(int value)
        {
            return string.Format("You entered: {0}", value);
        }

        public CompositeType GetDataUsingDataContract(CompositeType composite)
        {
            if (composite == null)
            {
                throw new ArgumentNullException("composite");
            }
            if (composite.BoolValue)
            {
                composite.StringValue += "Suffix";
            }
            return composite;
        }

        public Stock GetStock (string stockName)
        {
            StockLogic result = new StockLogic();
            return result.GetByStockName(stockName);
        }

        public void AddStock (Stock _stock)
        {
            StockLogic result = new StockLogic();
            result.AddNewStock(_stock);
        }
    
    }
}
